import type { App } from 'vue'
import { ElLoading, ElScrollbar, ElButton } from 'element-plus'

// 需要全局注册的插件
const plugins = [ElLoading]

// 需要全局注册的组件
const components = [ElScrollbar, ElButton]

export const setupElementPlus = (app: App<Element>) => {
  // 注册插件
  plugins.forEach(plugin => {
    app.use(plugin)
  })

  // 注册组件
  components.forEach(component => {
    app.component(component.name || '', component)
  })
}
